<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>补方列表</title>
    <link rel="shortcut icon" href="favicon.ico">
    <script src="../../res/js/comm.js?v=1.26.0"></script>
    <!--写公共的css文件-->
    <link href="../../res/plugins/bootstrap/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="../../res/plugins/bootstrap/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="../../res/plugins/bootstrap/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="../../res/plugins/bootstrap/css/animate.min.css" rel="stylesheet">
    <link href="../../res/plugins/bootstrap/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="../../res/plugins/layerui/layui/css/layui.css" media="all">
    <!--共用的js文件-->
    <script src="../../res/js/openx.js"></script>
    <!--表格控件-->
    <script src="../../res/plugins/bootstrap/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="../../res/plugins/bootstrap/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="../../res/plugins/bootstrap/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="../../res/plugins/bootstrap/js/plugins/bootstrap-table/table-export/bootstrap-table-export.js"></script>
    <script src="../../res/plugins/bootstrap/js/plugins/bootstrap-table/table-export/tableExport.js"></script>
    <!--弹出层控件-->
    <script src="../../res/plugins/layerui/layer/layer.js"></script>
    <!--模版控件-->
    <script src="../../res/plugins/layerui/layer/laytpl.js"></script>
    <script src="../../res/js/utils.js"></script>
    <script src="../../res/plugins/layerui/layui/layui.js" charset="utf-8"></script>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-info">
        <div class="panel-heading"><i class="fa fa-info-circle"></i> 补方列表</div>
        <div class="panel-body">
            <div class="ibox-query">
                <form id="queryForm" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">顶级渠道</label>
                        <div class="col-sm-2" name="channelPluginsDiv"></div>

                        <label class="col-sm-1 control-label">订单编码</label>
                        <div class="col-sm-2"><input name="orderCode" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">补方状态</label>
                        <div class="col-sm-2">
                            <select name="supplyPresStatus" class="form-control">
                                <option value="">--请选择--</option>
                                <option value="PENDING">待审核</option>
                                <option value="REVIEW_SUCCESS">审核成功</option>
                                <option value="REVIEW_FAILURE">审核失败</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">开始时间</label>
                        <div class="col-sm-2">
                            <input class="layui-input" id='startTime' name="startTime" placeholder="下单开始时间" type="text" readonly>
                        </div>
                        <label class="col-sm-1 control-label">结束时间</label>
                        <div class="col-sm-2">
                            <input class="layui-input" id='endTime' name="endTime" placeholder="下单结束时间" type="text" readonly>
                        </div>
                        <div class="col-sm-3" style="text-align: right">
                            <button class="btn btn-info" onclick='$.openx.query()' type="button"><i
                                    class="glyphicon glyphicon-search"></i> 查询
                            </button>
                            &nbsp;
                            <button class="btn btn-info" onclick="resetForm()" type="button"><i
                                    class="glyphicon glyphicon-share-alt"></i> 重置
                            </button>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                </form>
            </div>
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="bars pull-left">
                        <p>
                            <button class="btn btn-sm btn-primary" onclick="reviewSuccess()" type="button"> 审核通过</button>
                            <button class="btn btn-sm btn-danger" onclick="reviewFailure()" type="button"> 驳回审核</button>
                        </p>
                    </div>
                    <table id="table" data-show-export="true">
                        <thead>
                        <tr>
                            <th data-checkbox="true" ></th>
                            <th data-align="center" data-field="orderCode" data-formatter="showOrderDetailFormat">订单号</th>
                            <th data-align="center" data-field="topChannelCode" data-formatter="topChannelFormat">顶级渠道</th>
                            <th data-align="center" data-field="channelCode">渠道编号</th>
                            <th data-align="center" data-field="channelName">渠道名称</th>
                            <th data-align="center" data-field="needReceiveAmount">益丰实收金额</th>
                            <th data-align="center" data-field="createTime" data-formatter='createTimeFormat'>创建时间</th>
                            <th data-align="center" data-field="modifyTime" data-formatter='createTimeFormat'>变更时间</th>
                            <th data-align="center" data-field="supplyPresStatus" data-formatter="supplyPresStatusFormat">补方状态</th>
                            <th data-align="center" onclick="showAll()" data-field="remark" data-formatter='remarkFormat'>备注</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>


<!-- 订单详情-->
<script type="text/html" id="orderDetailTpl">
    <div id="orderDetailDiv" style="padding: 15px">
        <p>
            <button type="button" class="btn btn-danger btn-xs" onclick="showRecipe('{{d.topChannelCode}}')">
                查看处方
            </button>
        </p>
        <table class="layui-table">
            <tbody>
            <tr>
                <td rowspan="5" class="layui-table-td-bg">基本信息:</td>
                <td class="layui-table-td-bg">渠道</td>
                <td class="text-center" width="150px"> {{d.channelName ? d.channelName :"" }}</td>
                <td class="layui-table-td-bg">订单号</td>
                <td class="text-center">{{d.orderCode ? d.orderCode :"" }}</td>
                <td class="layui-table-td-bg">父订单编码</td>
                <td class="text-center">{{d.parentOrderCode ? d.parentOrderCode :"" }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">商品总金额</td>
                <td class="text-center">{{d.goodsTotalAmount ? d.goodsTotalAmount : 0}}</td>
                <td class="layui-table-td-bg">益丰实收金额</td>
                <td class="text-center">{{d.needReceiveAmount ? d.needReceiveAmount :0 }}</td>
                <td class="layui-table-td-bg">优惠总金额</td>
                <td class="text-center">{{d.preferentialTotalAmount ? d.preferentialTotalAmount :0 }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">第三方补贴金额</td>
                <td class="text-center">{{d.subsidyTotalAmount ? d.subsidyTotalAmount :0 }}</td>
                <td class="layui-table-td-bg">用户实付金额</td>
                <td class="text-center">{{d.customerNeedPayAmount ? d.customerNeedPayAmount :0 }}</td>
                <td class="layui-table-td-bg">第三方订单号</td>
                <td class="text-center">{{d.outTradeCode ? d.outTradeCode :"" }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">配送类型</td>
                <td class="text-center">{{d.deliveryType ? d.deliveryType:""}}</td>
                <td class="layui-table-td-bg">配送费用</td>
                <td class="text-center">{{d.deliveryAmount ? d.deliveryAmount :0}}</td>
                <td class="layui-table-td-bg">POS单号</td>
                <td class="text-center">{{(d.posCode && d.posCode!='000000') ? d.posCode :"" }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">收款方</td>
                <td class="text-center">{{d.payeeDesc ? d.payeeDesc :"" }}</td>
                <td class="layui-table-td-bg">下单时间</td>
                <td class="text-center">{{d.createTime ? d.createTime:""}}</td>
                <td class="layui-table-td-bg">退货退款</td>
                <td class="text-center">{{d.refundAmount ? '-'+d.refundAmount:0}}</td>

            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg">收件人信息</td>
                <td class="layui-table-td-bg">收件人姓名</td>
                <td class="text-center">{{d.receiverName?d.receiverName:""}}</td>
                <td class="layui-table-td-bg">收件人电话</td>
                <td class="text-center">{{d.receiverPhone?d.receiverPhone:""}}</td>
                <td class="layui-table-td-bg">收件人地址</td>
                <td class="text-center">{{d.address?d.address.replace(/-/g, ""):""}}</td>
            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg">其它信息</td>
                <td class="layui-table-td-bg">包装费</td>
                <td class="text-center">{{d.packingAmount?d.packingAmount: 0}}</td>
                <td class="layui-table-td-bg">营业员</td>
                <td class="text-center">{{d.employee?d.employee:""}}</td>
                <td class="layui-table-td-bg">&nbsp;</td>
                <td class="text-center">&nbsp;</td>
            </tr>
            <tr>
                <td rowspan="1" colspan="7" class="layui-table-td-bg">商品信息</td>
            </tr>
            <tr>
                <td colspan="7" style="padding: 4px;">
                    <table class="layui-table" style="text-align: center;margin: 0px">
                        <thead>
                        <tr>
                            <th style="text-align: center">商品图片</th>
                            <th style="text-align: center">商品编码</th>
                            <th style="text-align: center">商品名称</th>
                            <th style="text-align: center">UPC(69)码</th>
                            <th style="text-align: center">规格</th>
                            <th style="text-align: center">推荐指数</th>
                            <th style="text-align: center">执行价</th>
                            <th style="text-align: center">记账价</th>
                            <th style="text-align: center">数量</th>
                            <th style="text-align: center">记账价合计(元)</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{# layui.each(d.listGoods, function(index, item){ }}
                        {{# if(d.prescriptionGoodsCodes.indexOf(item.goodsCode) > -1 ){ }}
                        <tr style="color: #269abc">
                        {{# } else { }}
                        <tr>
                        {{# } }}
                            <td><img src="{{item.imgeUrl}}" width="40px" height="40px"></td>
                            <td> {{item.goodsCode}}</td>
                            <td>{{item.goodsName}}</td>
                            <td>{{item.mainBarcode?item.mainBarcode:"无"}}</td>
                            <td>{{item.standard ?item.standard:"无"}}</td>
                            <td>{{item.recommendIndex ?item.recommendIndex:"无"}}</td>
                            <td>{{item.exercisePrice ? item.exercisePrice : 0}}</td>
                            <td>{{item.accountPrice ? item.accountPrice : 0}}</td>
                            <td>{{item.quantity ? item.quantity : 0}}</td>
                            <td>{{item.quantity ? Math.round(accMul(accMul(item.quantity , (item.accountPrice ?
                                item.accountPrice : 0)),100))/100 : 0}}
                            </td>
                        </tr>
                        {{# }); }}
                        </tbody>
                    </table>
                </td>
            </tr>


            <tr>
                <td rowspan="1" class="layui-table-td-bg">发票信息</td>
                <td class="layui-table-td-bg">纳税人识别码</td>
                <td class="text-center">{{d.invoiceCode ? d.invoiceCode:"-"}}</td>
                <td class="layui-table-td-bg">发票抬头</td>
                <td class="text-center">{{d.invoiceTitle ? d.invoiceTitle :"-"}}</td>
                <td class="layui-table-td-bg">发票内容</td>
                <td class="text-center">{{d.invoiceContent ? d.invoiceContent :"-" }}</td>
            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg"></td>
                <td class="layui-table-td-bg">接收人手机</td>
                <td class="text-center">{{d.invoiceMobile ? d.invoiceMobile:""}}</td>
                <td class="layui-table-td-bg">接收人邮箱</td>
                <td class="text-center">{{d.invoiceEmail ? d.invoiceEmail :""}}</td>
                <td class="layui-table-td-bg"></td>
                <td class="text-center"></td>
            </tr>

            <tr>
                <td rowspan="1" class="layui-table-td-bg">附加信息:</td>
                <td colspan="7">
                    {{# layui.each(d.additionalInfos, function(index, item){ }}
                    {{index+1}} 、 {{item.infoName ? item.infoName :""}} ： {{item.infoValue ? item.infoValue :""}} &nbsp;&nbsp;&nbsp;&nbsp;
                    {{# }); }}
                </td>
            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg">备注:</td>
                <td colspan="7">{{d.remark?d.remark:""}}</td>
            </tr>
            {{# layui.each(d.orderRefundList, function(index, item){ }}
            <tr>
                <td rowspan="1" colspan="7" class="layui-table-td-bg">退货信息</td>
            </tr>
            <tr>
                <td colspan="7" style="padding: 4px;">
                    <table class="layui-table" style="text-align: center;margin: 0px">


                        <thead>
                        <tr>
                            <th style="text-align: center">退货单编码</th>
                            <th style="text-align: center">pos编码</th>
                            <th style="text-align: center">订单编码</th>
                            <th style="text-align: center">退款总金额</th>
                            <th style="text-align: center">是否需要退运费</th>
                            <th style="text-align: center">退货原因</th>
                            <th style="text-align: center">状态</th>
                            <th style="text-align: center">退货运单号</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{{item.refundCode}}</td>
                            <td>{{(item.posCode && item.posCode!='000000')?item.posCode:""}}</td>
                            <td>{{item.orderCode}}</td>
                            <td>{{item.totalAmount?item.totalAmount:"0.00"}}</td>
                            <td>{{item.isRefundFreight ? (item.isRefundFreight ==='Y' ? "是" : "否") :"-"}}</td>
                            <td>{{item.reason ? item.reason : "" }}</td>
                            <td>{{item.status
                                ==='1'?"已退货":item.status==='2'?"退货中":item.status==='0'?"待审核":item.status==='3'?"已拒绝":item.status==='4'?"已关闭":item.status==='9'?"初始化":"-"}}
                            </td>
                            <td>{{item.waybillCode?item.waybillCode:""}}</td>
                        </tr>
                        </tbody>
                        <tr>
                            <td colspan="8" style="padding: 4px;">
                                <table class="layui-table" style="text-align: center;margin: 0px">
                                    <thead>
                                    <tr>
                                        <th style="text-align: center"></th>
                                        <th style="text-align: center">商品图片</th>
                                        <th style="text-align: center">商品编码</th>
                                        <th style="text-align: center">商品名称</th>
                                        <th style="text-align: center">UPC(69)码</th>
                                        <th style="text-align: center">规格</th>
                                        <th style="text-align: center">执行价</th>
                                        <th style="text-align: center">记账价</th>
                                        <th style="text-align: center">数量</th>
                                        <th style="text-align: center">记账价合计(元)</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {{# layui.each(item.refundGoods, function(index, item2){ }}
                                    <tr>
                                        <td></td>
                                        <td><img src="{{item2.imgeUrl}}" width="40px" height="40px"></td>
                                        <td> {{item2.goodsCode}}</td>
                                        <td>{{item2.goodsName}}</td>
                                        <td>{{item2.mainBarcode?item2.mainBarcode:"无"}}</td>
                                        <td>{{item2.standard ?item2.standard:"无"}}</td>
                                        <td>{{item2.exercisePrice ? item2.exercisePrice : 0}}</td>
                                        <td>{{item2.accountPrice ? item2.accountPrice : 0}}</td>
                                        <td>{{item2.quantity ? item2.quantity : 0}}</td>
                                        <td>{{item2.quantity ? Math.round(accMul(accMul(item2.quantity ,
                                            (item2.accountPrice ? item2.accountPrice : 0)),100))/100 : 0}}
                                        </td>
                                    </tr>
                                    {{# }); }}
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8"></td>
                        </tr>

                    </table>
                </td>
            </tr>
            {{# }); }}
            <tr>
            </tr>

            </tbody>
        </table>
    </div>
</script>


<script type="text/javascript">
    (function () {
        $.openx.loadScript(['../../res/plugins/yifeng/channel.js','../../res/plugins/yifeng/orderStatus.js', '../../res/plugins/iCheck/icheck.min.js', '../../js/order/supplyPresOrderList.js', '../../res/js/ajaxUtil.js']);
    })();
</script>
</html>